package com.qc31.monitorlib.custom

import android.content.Context
import android.util.AttributeSet
import androidx.recyclerview.widget.RecyclerView
import com.qc31.baselib.utils.ScreenUtil

/** @Author Jasper @Time 2021/10/8 17:19 @Desc */
class HeightRecyclerView : RecyclerView {
    constructor(context: Context) : super(context)
    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(
        context,
        attrs,
        defStyle
    )

    override fun onMeasure(widthSpec: Int, heightSpec: Int) {
        val heightSpe =
            MeasureSpec.makeMeasureSpec(ScreenUtil.dp2px(context, 290), MeasureSpec.AT_MOST);
        super.onMeasure(widthSpec, heightSpe)
    }
}